package com.itheima.thread;

/**
 * @author wz
 * @company 公司
 * @create 2020-03-05 10:07
 */
public class Demo1CreateThread {
    public static void main(String[] args) {
        new Demo1().start();
        new Demo1().start();
    }

   static class Demo1 extends Thread{
        @Override
        public void run() {
            //获取线程名称
            String  name = Thread.currentThread().getName();
            for (int i = 0; i < 5; i++) {
                System.out.println(name + "内容是:" + i);
            }

        }
    }
}
